package io.github.codelifeleno.jdbrelease.util;

class DataUtilTest {

    @org.junit.jupiter.api.Test
    void getDataDefault() {
        // 示例1：传入null，返回默认值
        System.out.println(DataUtil.getDataDefault(null, String.class)); // ""
        System.out.println(DataUtil.getDataDefault(null, Integer.class)); // 0

        // 示例2：传入非null对象，类型匹配
        System.out.println(DataUtil.getDataDefault(123, Integer.class)); // 123
        System.out.println(DataUtil.getDataDefault("Hello", String.class)); // "Hello"

        // 示例3：传入非null对象，类型不匹配
        System.out.println(DataUtil.getDataDefault(123, String.class)); // ""
        System.out.println(DataUtil.getDataDefault("Hello", Integer.class)); // 0
    }
}